Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @roderik, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request significantly improves the flexibility of the Helm charts for network bootstrapper and network nodes by enabling the configuration of init containers. This allows users to specify tasks that must complete successfully before the main application containers start, facilitating complex initialization logic directly within the Helm chart values. The changes also include updates to documentation generation to reflect these new configurable options.
Highlights
- Configurable Init Containers: Introduced the ability to define init containers for both bootstrapper and node pods using Helm values, supporting
tplfor dynamic configuration. - Enhanced Helm Documentation: Expanded
valuesannotations andhelm-docsoutput to cover the newinitContainerskeys, ensuring comprehensive documentation. - Documentation Guidelines: Added specific guidelines to
AGENTS.mdon how to maintainhelm-docsformat and use compatible comment blocks forvalues.yamlentries.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in pull request comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
|
To view in Slack, search for: 1758126237.278809 |
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Please bump the chart versions in Chart.yaml for both network-nodes and network-bootstrapper to reflect this new feature.
- Consider refactoring the inline initContainers logic in the bootstrapper job template to reuse the shared
nodes.renderInitContainershelper for consistency and DRYness.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Please bump the chart versions in Chart.yaml for both network-nodes and network-bootstrapper to reflect this new feature.
- Consider refactoring the inline initContainers logic in the bootstrapper job template to reuse the shared `nodes.renderInitContainers` helper for consistency and DRYness.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
This pull request introduces a valuable feature by allowing configurable init containers for both the bootstrapper and node pods. The implementation is flexible, supporting both YAML lists and raw strings for defining containers, and includes helpful documentation and examples in the values.yaml files. The use of a shared helper template for rendering init containers in the network-nodes chart is a good practice.
I've found one high-severity issue in the new helper template (_helpers.tpl) where the combination of indentation and whitespace control could lead to incorrect YAML rendering. I've provided a suggestion to make the template more robust and idiomatic.
Overall, this is a great addition, and with the suggested fix, it will be ready for merging.
| {{- define "nodes.renderInitContainers" -}} | ||
| {{- $ctx := .context -}} | ||
| {{- $containers := .containers -}} | ||
| {{- $indent := .indent | default 2 -}} | ||
| {{- if $containers }} | ||
| {{- if kindIs "string" $containers -}} | ||
| {{ tpl $containers $ctx | nindent $indent }} | ||
| {{- else -}} | ||
| {{ tpl (toYaml $containers) $ctx | nindent $indent }} | ||
| {{- end -}} | ||
| {{- end -}} | ||
| {{- end }} |
There was a problem hiding this comment.
The combination of indentation within the define block and aggressive whitespace stripping ({{- ... -}}) is fragile and can lead to unexpected template rendering issues or parsing errors. It's safer and more idiomatic to remove the indentation for the logic inside the define block and rely on whitespace control to manage the flow. This makes the template easier to read and less prone to errors when it's modified in the future.
{{- define "nodes.renderInitContainers" -}}
{{- $ctx := .context -}}
{{- $containers := .containers -}}
{{- $indent := .indent | default 2 -}}
{{- if $containers -}}
{{- if kindIs "string" $containers -}}
{{ tpl $containers $ctx | nindent $indent }}
{{- else -}}
{{ tpl (toYaml $containers) $ctx | nindent $indent }}
{{- end -}}
{{- end -}}
{{- end -}}
Summary
Testing
Summary by Sourcery
Add support for configurable init containers in the network-bootstrapper and network-nodes Helm charts, including templating for shared, validator, and RPC pods, and update documentation accordingly.
New Features:
Enhancements:
Documentation: